/**
 * 
 */
package org.rrest.file;

import java.io.Serializable;
import java.util.Random;

public class FileInfo implements Serializable {
	private static final long serialVersionUID = 1L;

	private String name;
	private byte[] content;

	public FileInfo(String name, byte[] content) {
		this.setName(name);
		this.setContent(content);
	}

	public FileInfo() {

	}

	public static FileInfo randomFile(int size) {
		byte[] b = new byte[size];
		new Random().nextBytes(b);
		return new FileInfo("random_name_" + new Random().nextInt(), b);
	}

	public byte[] getContent() {
		return content;
	}

	public void setContent(byte[] content) {
		this.content = content;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
